<? if ($c = stack('name')) {
	
	require_once('_lib/formvalidator.php');

	
	$fields = array(
		'region_id' => 'req:Потрібно обрати',
		'issue' => 'req:Потрібно заповнити',
	);
	
	$_values	= array('question_id', 'region_id', 'issue', 'department_id');

	$uuid = gccGetUUID();
	$now = parse_today();
	foreach(str_split('dmhMs') as $v) $now[$v] = d2d($now[$v]);
	$now = "$now[d].$now[m].$now[y]:$now[h]:$now[M]:$now[s]";

	$_record = array('id' => $uuid, 'create_date' => $now, 'person_id' => gccUserInfo('person_id'));
//debug($_record);				

//dbdebug();

	if (($uuid = gccHuuid(param('delete'))) && ($d = datafetch('db_item', 'cs_claim', "id=$uuid AND person_id=".gccUserInfo('person_id')))) {

		dataset('db_delete', 'cs_claim', "id=$uuid");

	}

	header("Location: "._transformURL($CURRENT->url, array('remove_params' => 'all', 'add_param' => 'show:draft')));
	exit;
		

unstack();
}